import request from '@/utils/request'
import qs from 'qs'

/** 推广统计信息 */
export function ExtensionManagementInfo(data) {
  return request({
    url: '/shop/extensionManagement/info',
    method: 'post',
    data
  })
}

/** 获取代理列表 */
export function ExtensionProxyList(data) {
  return request({
    url: '/shop/extensionManagement/proxyList',
    method: 'post',
    data
  })
}

/** 推广统计详情列表 */
export function ExtensionStaticDetail(data) {
  return request({
    url: '/shop/extensionManagement/staticDetail',
    method: 'post',
    data
  })
}

/** 导出推广统计详情列表 */
export function ExtensionExportData(data) {
  return request({
    url: '/shop/extensionManagement/exportData',
    method: 'post',
    responseType: 'blob', // arraybuffer
    data
  })
}

/** 获取推广员列表 */
export function ExtensionManagementList(data) {
  return request({
    url: '/shop/extensionManagement/list',
    method: 'post',
    data
  })
}
/** 添加推广员 */
export function ExtensionManagementAdd(data) {
  return request({
    url: '/shop/inventoryManagement/add',
    method: 'post',
    data
  })
}

/** 推广员删除 */
export function extensionManagementDel(data) {
  return request({
    url: '/shop/extensionManagement/delPromoter',
    method: 'post',
    data
  })
}

/** 推广员编辑 */
export function InventoryManagementEdit(data) {
  return request({
    url: '/shop/inventoryManagement/Edit',
    method: 'post',
    data
  })
}

/** 推广员信息 */
export function ExtensionPromoterDetail(data) {
  return request({
    url: '/shop/extensionManagement/PromoterDetail',
    method: 'post',
    data
  })
}

/** 推广员详情客户列表 */
export function ExtensionPromoterLJKH(data) {
  return request({
    url: '/shop/extensionManagement/LJKH',
    method: 'post',
    data
  })
}

/** 提现记录列表 */
export function ExtensionPromoterTXJL(data) {
  return request({
    url: '/shop/extensionManagement/TXJL',
    method: 'post',
    data
  })
}

/** 添加推广方案 */
export function schemeAdd(data) {
  return request({
    url: '/shop/scheme/add',
    method: 'post',
    data
  })
}
/** 获取推广方案列表 */
export function schemeList(data) {
  return request({
    url: '/shop/scheme/List',
    method: 'post',
    data
  })
}
/** 推广方案删除 */
export function schemeDel(data) {
  return request({
    url: '/shop/scheme/del',
    method: 'post',
    data
  })
}

/** 推广商品列表 */
export function extensionList(data) {
  return request({
    url: '/shop/extension/list',
    method: 'post',
    data
  })
}

/** 未推广商品列表 */
export function unExtensionList(data) {
  return request({
    url: '/shop/unExtension/list',
    method: 'post',
    data
  })
}

/** 推广商品取消推广 */
export function extensionCancel(data) {
  return request({
    url: '/shop/extension/cancel',
    method: 'post',
    data
  })
}

/** 新增推广-根据商品获取门店列表 */
export function GetExtensionManagement(data) {
  return request({
    url: '/shop/extensionManagement/getStore',
    method: 'post',
    data
  })
}

/** 推广方案-编辑 */
export function schemeEdit(data) {
  return request({
    url: '/shop/scheme/Edit',
    method: 'post',
    data
  })
}

/** 新增推广-根据商品获取门店列表 */
export function extensionGetStore(data) {
  return request({
    url: '/shop/extensionManagement/getStore',
    method: 'post',
    data
  })
}
/** 推广方案-详情 */
export function schemeDetail(data) {
  return request({
    url: '/shop/scheme/Detail',
    method: 'post',
    data
  })
}

/** 添加推广商品-对未设置推广商品进行分成比例设置 */
export function updateProportion(data) {
  return request({
    url: '/shop/promotion/updateProportion',
    method: 'post',
    data
  })
}
/** 批量修改分成比例 */
export function promotionUpdate(data) {
  return request({
    url: '/shop/promotion/update',
    method: 'post',
    data
  })
}

/** 推广管理-推广员详情列表 */
export function extensionManagement(data) {
  return request({
    url: '/shop/extensionManagement/promoterList',
    method: 'post',
    data
  })
}

/** 商品详情 */
export function commodityDetail(data) {
  return request({
    url: '/commodity/commodityDetail',
    method: 'post',
    data: qs.stringify(data)
  })
}

/** 推广管理-根据推广员id获取推广链接信息 */
export function getExtensionInfo(data) {
  return request({
    url: '/shop/extensionManagement/getLinkInfo',
    method: 'post',
    data
  })
}

/** 推广管理-根据推广员id获取推广员详情 */
export function getPromoterInfo(data) {
  return request({
    url: '/shop/extensionManagement/PromoterDetail',
    method: 'post',
    data
  })
}
